package com.hsj.common.system.entity;

import com.cjxch.supermybatis.base.annotation.PrimaryKey;
import com.cjxch.supermybatis.base.annotation.Table;
import com.cjxch.supermybatis.base.entity.BaseEntity;
import lombok.*;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 用户
 * @Author: Czy
 * @Date: 2024-01-23 23:03:26
 * @Email: 314170122@qq.com
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Table("t_sys_user")
public class SysUserDo extends BaseEntity {
 
    /**
    * 
    */
    @PrimaryKey
    private Integer id;
 
    /**
    * 登录名
    */
    private String userName;
 
    /**
    * 登录密码MD5加密
    */
    private String password;
 
    /**
    * 真实姓名
    */
    private String realName;
 
    /**
    * 所属部门id
    */
    private Integer deptId;
 
    /**
    * MD5加密盐
    */
    private String salt;
 
    /**
    * 创建时间
    */
    private Date createTime;
 
    /**
    * 修改时间
    */
    private Date modifyTime;

    @Override
    public void onSave() {
        this.createTime = new Date();
        this.modifyTime = new Date();
    }

    @Override
    public void onUpdate() {
        this.modifyTime = new Date();
    }
}
